import { createApp } from 'vue'
import App from './App.vue'


// 引用公共样式
import './assets/app.css'



//导入Elementplus
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';



const pinia = createPinia()
// 特别注意：固化插件是 pinia.use 并不是 app.use
pinia.use(piniaPluginPersistedstate);


//导入路由组件
import router from '@/router'


const app = createApp(App)

//注册路由表, 注册  RouterView、RouterLink
app.use(router)

app.use(pinia)

//全局组件 (在Vue文件中使用之前 不需要import)
app.use(ElementPlus, {
    locale: zhCn,
    size:"default"
  }
)
// 注册系统库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  // console.log('key',key) 
  app.component(key, component)
}

app.mount('#app')